﻿@{
    YouErYuanModels.Teacher user = HttpContext.Current.Session["user"] as YouErYuanModels.Teacher;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title-幼儿园</title>
    <link href="../../Content/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="../../Content/assets/global/plugins/bootstrap-daterangepicker/daterangepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/morris/morris.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/fullcalendar/fullcalendar.min.css" rel="stylesheet" type="text/css" />

    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="../../Content/assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" />
    <link href="../../Content/assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="../../Content/assets/layouts/layout2/css/layout.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/layouts/layout2/css/themes/blue.min.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="../../Content/assets/layouts/layout2/css/custom.min.css" rel="stylesheet" type="text/css" />
    <!-- 弹出层 -->
    <link href="../../Content/assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css" />

    <!-- 日期控件 -->
    <link href="../../Content/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/assets/global/plugins/clockface/css/clockface.css" rel="stylesheet" type="text/css" />

    <!--js自定义引用-->
    <script src="../../Scripts/jquery-1.10.2.min.js"></script>
    <script src="../../Scripts/CryptoJS/core-min.js"></script>
    <script src="../../Scripts/CryptoJS/enc-base64-min.js"></script>
    <script src="../../Scripts/common.js"></script>
    <script src="../../Scripts/template-native.js"></script>

    <style type="text/css">
        .title-content {
            font-size: 20px;
            margin-bottom: 10px;
        }
    </style>
</head>
<!--page-header-fixed-->
<body class="page-sidebar-closed-hide-logo page-container-bg-solid">
    <!-- BEGIN HEADER -->
    <div class="page-header navbar">
        <!--上面的div去掉了类样式navbar-fixed-top-->
        <!-- BEGIN HEADER INNER -->
        <div class="page-header-inner ">
            <!-- BEGIN LOGO -->
            <div class="page-logo">
                <div class="menu-toggler sidebar-toggler">
                </div>
            </div>
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
            <div class="page-top">
                <div class="top-menu">
                    <ul class="nav navbar-nav pull-right">
                        <li class="dropdown dropdown-user">
                            <a href="#masterAccountSetting" onclick="clickDiv('@user.Teachername','@user.Phone','@user.password')" data-toggle="modal" class="dropdown-toggle">
                                <img alt="" class="img-circle" src="../../Content/assets/layouts/layout2/img/avatar.png" />
                                <span class="username username-hide-on-mobile">
                                    @if (user.Type.Equals("3"))
                                    {
                                        <span>管理员：</span><span style="color:red;">@user.Teachername</span>
                                    }
                                    else if (user.Type.Equals("2"))
                                    {
                                        <span>园长：</span><span style="color:red;">@user.Teachername</span>
                                    }
                                </span>
                                <!--<i class="fa fa-angle-down"></i>-->
                            </a>
                        </li>
                        <li class="dropdown dropdown-extended quick-sidebar-toggler">
                            <img src="../../Content/img/2233.png" title="退出" id="exitSystem" />
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="clearfix"> </div>
    <div class="page-container" style="margin-top:0px;">
        <div class="page-sidebar-wrapper">
            <div class="page-sidebar navbar-collapse collapse">
                <ul class="page-sidebar-menu  page-header-fixed page-sidebar-menu-hover-submenu " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200">

                    @if (user.Type.Equals("3"))
                    {
                    <!--管理员菜单-->
                        <li class="nav-item">
                            <a href="/Home/YEYManage" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">幼儿园管理</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/BaseData" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">基础数据管理</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/loginReport" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">登录统计</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/modelReport" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">模块使用统计</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                    }
                    else
                    {
                    <!--园长菜单-->
                        <li class="nav-item">
                            <a href="/Home/ChaKanSetting" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">设置查看</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item  ">
                            <a href="/Home/TeacherSetting" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">教师设置</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/VideoSetting" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">视频设置</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/CourseSetting" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">课程设置</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/RispeSetting" class="nav-link nav-toggle">
                                <i class="icon-settings"></i>
                                <span class="title">食谱设置</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/SchoolInfoSetting" class="nav-link nav-toggle">
                                <i class="icon-bulb"></i>
                                <span class="title">校园简介</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/NewsPublish" class="nav-link nav-toggle">
                                <i class="icon-bulb"></i>
                                <span class="title">新闻发布</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="/Home/TongzhiPublish" class="nav-link nav-toggle">
                                <i class="icon-bulb"></i>
                                <span class="title">通知发布</span>
                                <span class="selected"></span>
                                <span class="arrow open"></span>
                            </a>
                        </li>
                    }

                </ul>
            </div>
        </div>
        <div class="page-content-wrapper">
            <!-- BEGIN CONTENT BODY -->
            <div class="page-content">
                <div style="position:relative;top:-10px;">
                    @RenderBody()
                </div>
            </div>
            <!-- END CONTENT BODY -->
        </div>

    </div>
    <div class="page-footer">
        <div class="page-footer-inner">
            &copy; 勤道科技
        </div>
        <div class="scroll-to-top">
            <i class="icon-arrow-up"></i>
        </div>
    </div>

    <!-- 弹出层，设置账户-->
    <div id="masterAccountSetting" class="modal fade" data-focus-on="input:first">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">账户设置</h4>
            </div>
            <div class="modal-body">
                <div style="margin-left:10px;">
                    <div action="#" class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="yzName" class="col-md-4 control-label">姓名</label>
                            <div class="col-md-4">
                                <input type="text" class="form-control" id="masterTeacherName" placeholder="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="yzAccount" class="col-md-4 control-label">登录账号</label>
                            <div class="col-md-4">
                                <input type="text" class="form-control" onkeyup="masterCkPhone()" id="masterPhone" placeholder="">
                            </div>
                            <div class="col-md-4" id="ckMasterPhoneMsg" style="line-height:31px;"></div>
                        </div>
                        <div class="form-group">
                            <label for="yzPwd" class="col-md-4 control-label">登录密码</label>
                            <div class="col-md-4">
                                <input type="password" class="form-control" id="masterPwd" value="" placeholder="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <input type="hidden" id="masterOldPhone" />
                <input type="hidden" id="masterUserType" value="@user.Type" />
                <button class="btn default" data-dismiss="modal" id="masterCloseBtn" aria-hidden="true">关闭</button>
                <button class="btn green" data-dismiss="" onclick="masterSubmit()">提交</button>
            </div>
        </div>
    </div>

    <!-- 日期控件 -->
    <![endif]-->
    <!-- BEGIN CORE PLUGINS -->

    <script src="../../Content/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="../../Content/assets/global/plugins/moment.min.js" type="text/javascript"></script>

    <script src="../../Content/assets/global/plugins/morris/morris.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/morris/raphael-min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/counterup/jquery.waypoints.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/counterup/jquery.counterup.min.js" type="text/javascript"></script>

    @*
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/amcharts.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/serial.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/pie.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/radar.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/themes/light.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/themes/patterns.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amcharts/themes/chalk.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/ammap/ammap.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/ammap/maps/js/worldLow.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/amcharts/amstockcharts/amstock.js" type="text/javascript"></script>*@

    <script src="../../Content/assets/global/plugins/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
    @*<script src="../../Content/assets/global/plugins/jquery-easypiechart/jquery.easypiechart.min.js" type="text/javascript"></script>*@
    <script src="../../Content/assets/global/plugins/jquery.sparkline.min.js" type="text/javascript"></script>

    @*
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
        <script src="../../Content/assets/global/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>*@

    <script src="../../Content/assets/global/scripts/app.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/pages/scripts/dashboard.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/layouts/layout2/scripts/layout.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/layouts/layout2/scripts/demo.min.js" type="text/javascript"></script>
    <script src="../../Content/assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>

    <!--弹出层控制出生位置-->
    <script src="../../Content/assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript"></script>
    <script src="../../Content/assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript"></script>

    <!--日期控件-->
    <!--<script src="../../Content/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>-->
    <!--<script src="../../Content/assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js" type="text/javascript"></script>-->
    <!--<script src="../../Content/assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>-->
    <!--<script src="../../Content/assets/global/plugins/clockface/js/clockface.js" type="text/javascript"></script>-->
    <!--<script src="../../Content/assets/global/plugins/bootstrap-daterangepicker/daterangepicker.min.js" type="text/javascript"></script>-->
    <script src="../../Content/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>
    <script src="../../Content/assets/pages/scripts/components-date-time-pickers.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {
            //设置菜单选中样式
            $(".nav-item").removeClass("active open");
            $(".nav-item").each(function (index, element) {
                var href = $(this).find("a").attr("href");
                var currentURL = window.location.href;
                var index = currentURL.indexOf(href);
                if (index != -1) {
                    $(this).addClass("active open");
                }
            });
            //退出系统
            $("#exitSystem").click(function () {
                var isTrue = confirm("确定退出系统吗？");
                if (isTrue) {
                    AjaxCustom({
                        url: "/Login/Exit",
                        callBack: function (data) {
                            if (data.code == "1") {
                                AlertMsg("注销账号成功");
                                window.location.href = "/Login/LoginView";
                            }
                        }
                    });
                }
            });
        });

        //弹出层赋值
        function clickDiv(name, phone, pwd) {
            $("#ckMasterPhoneMsg").html("");
            $("#masterTeacherName").val(name);
            $("#masterOldPhone").val(phone);
            $("#masterPhone").val(phone);
            $("#masterPwd").val(pwd);
        }

        //验证手机号是否存在
        function masterCkPhone() {
            $("#ckMasterPhoneMsg").html("");
            var phone = $("#masterPhone").val();
            var oldPhone = $("#masterOldPhone").val();
            var userType = $("#masterUserType").val();//用户类型，2=yz,3=adm
            if (phone == "") {
                return;
            }
            if (userType == "2") {
                var re = /^1\d{10}$/;
                if (!re.test(phone)) {
                    $("#ckMasterPhoneMsg").css("color", "red");
                    $("#ckMasterPhoneMsg").html("号码有误");
                    return;
                }
            }
            if (oldPhone != phone) {
                AjaxCustom({
                    url: "/TeacherSetting/CheckTeacherPhone",
                    type: "get",
                    parames: { phone: phone },
                    callBack: function (obj) {
                        if (obj.code == 1) {
                            $("#ckMasterPhoneMsg").html("账号已存在");
                            $("#ckMasterPhoneMsg").css("color", "red");
                        } else {
                            $("#ckMasterPhoneMsg").html("验证通过");
                            $("#ckMasterPhoneMsg").css("color", "green");
                        }
                    }
                });
            }
        }

        //提交账户设置
        function masterSubmit() {
            $("#ckMasterPhoneMsg").html("");
            var phone = $("#masterPhone").val();
            var name = $("#masterTeacherName").val();
            var pwd = $("#masterPwd").val();
            if (phone == "") {
                AlertMsg("手机号不能为空");
                return;
            }
            if (pwd == "") {
                AlertMsg("密码不能为空");
                return;
            }
            var userType = $("#masterUserType").val();//用户类型，2=yz,3=adm
            if (userType == "2") {
                var re = /^1\d{10}$/;
                if (!re.test(phone)) {
                    $("#ckMasterPhoneMsg").html("号码有误");
                    return;
                }
            }
            AjaxCustom({
                url: "/TeacherSetting/SaveUserSetting",
                type: "get",
                parames: { phone: phone, pwd: pwd, name: name },
                callBack: function (obj) {
                    if (obj.code == 11) {
                        $("#ckMasterPhoneMsg").html("账号已存在");
                        $("#ckMasterPhoneMsg").css("color", "red");
                    } else if (obj.code == 1) {
                        $("#ckMasterPhoneMsg").html("");
                        AlertMsg("保存成功,正在注销账号..");
                        //注销登录
                        AjaxCustom({
                            url: "/Login/Exit",
                            type: "get",
                            callBack: function (obj) {
                                if (obj.code == 1) {
                                    setTimeout(function () { window.location.href = "/Login/LoginView"; }, 1000);
                                }
                            }
                        });
                    }
                }
            });
        }


    </script>
</body>
</html>